<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>优惠列表</title>
<link rel="stylesheet" type="text/css" href="../img/base.css">
<script language="javascript" src="/img/jquery.js"></script>
<script language="javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	function selectAll(){
		var tof = $('#all_number').attr('checked');
		if(tof) $("input[name='number[]']:checkbox").attr('checked','checked');
		else $("input[name='number[]']:checkbox").attr('checked','');
	}
	
	function numberDisable(){
		var number_arr = $("input[name='number[]']:checked");
		if(number_arr.length > 0){
			return true;
		}else{
			alert('请选择要操作的优惠券');
			return false;	
		}
		
	}
	
	function search_data(){
		$('#op').val('search');
	}
	
	function number_verify(){
		$('#number_op').val('verify');
	}
	
	function number_disverify(){
		$('#number_op').val('disverify');
	}
	
	
	function number_send(){
		$('#number_op').val('send');	
	}
</script>
</head>
<body leftmargin="8" topmargin="8" background='../img/allbg.gif'>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td align='center' valign='top'>
        	<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
            	<tr>
                	<td height="28" background="../img/tbg.gif">
                    <div style="float:right;padding-right:6px;">
                    <a href='batch_verify.php' class='np coolbg'>批次审核</a> &nbsp;&nbsp;
                    </div>
                    </td>
                </tr>
            </table>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D1DDAA">
				<tr>
    				<td height="26" background="../img/tbg.gif">
                    <form action="" method="post">
    					<table width="98%" border="0" cellspacing="2" cellpadding="0">
     						<tr>
                            	<td>优惠码：</td>
                            	<td><input type='text' name='serial_number' id="serial_number" value="<{$serial_number}>" /></td>
                                <td>类型：</td>
     							<td>
                                	<select name="type_id" id="type_id">
                                    	<option value="0">请选择</option>
                                        <{foreach from=$coupon_type_list item=type}>
                                        <option value="<{$type.type_id}>" <{if $type.type_id == $type_id}>selected="selected"<{/if}>><{$type.type_name}></option>
                                        <{/foreach}>
                                    </select>
                                </td>
     						</tr>
                            <tr>
                            	<td>批次：</td>
     							<td>
                                	<select id="batch_id" name="batch_id">
                                    	<option value="0">请选择</option>
                                    	<{foreach from=$coupon_batch_list item=batch}>
                                    	<option value="<{$batch.batch_id}>" <{if $batch.batch_id == $batch_id}>selected="selected"<{/if}>><{$batch.batch_name}></option>
                                    	<{/foreach}>
                                    </select>
                                </td>
                            	<td>手机号码：</td>
                            	<td><input type='text' name='mobile' id="mobile" value="<{$mobile}>" /></td>
                            </tr>
                            <tr>
                            	<td>是否有效：</td>
                 				<td>
                                	<select id="is_disabled" name="is_disabled">
                                    	<option value="-99">请选择</option>
                                    	<option value="0" <{if $is_disabled === 0}>selected="selected"<{/if}>>有效</option>
                                        <option value="1" <{if $is_disabled == 1}>selected="selected"<{/if}>>无效</option>
                                        <option value="-1" <{if $is_disabled == -1}>selected="selected"<{/if}>>未审核</option>
                                        <option value="-2" <{if $is_disabled == -2}>selected="selected"<{/if}>>审核不通过</option>
                                    </select>
                                </td>
                                <td>使用情况：</td>
                                <td>
                                      <select id="remain_value_status" name="remain_value_status">
                                    	<option value="0">请选择</option>
                                    	<option value="3" <{if $remain_value_status == 3}>selected="selected"<{/if}>>已使用</option>
                                        <option value="2" <{if $remain_value_status == 2}>selected="selected"<{/if}>>使用中</option>
                                        <option value="1" <{if $remain_value_status == 1}>selected="selected"<{/if}>>未使用</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                            	<td colspan="4" align="center">
                                	<input type="hidden" id="op" name="op" value="" />
                                	<input type='submit' class="coolbg np" value='搜索' onClick="search_data()" />&nbsp;&nbsp;
                                   
                                </td>
                            </tr>
    					</table>
                    </form>
    				</td>
    			</tr>
 			</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr bgcolor="#FFFFFF">
                	<td height="4"></td>
                </tr>
			</table>
			<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA">
				<tr bgcolor="#E7E7E7">
					<td height="24" colspan="12" background="../img/tbg.gif">§优惠管理 &gt; 优惠码列表 &nbsp;</td>
				</tr>
                <form action="" method="post" name="frm" id="frm" onSubmit="return numberDisable()">
                <tr align="center" bgcolor="#FAFAF1" height="22">
                	<td width="50"><input type="checkbox" name="all_number" id="all_number" onClick="selectAll()" />全选</td>
                    <td>优惠码</td>
                    <td>类型</td>
                    <td>批次</td>
                    <td>总数</td>
                    <td>剩余数</td>
                    <td>打印价格</td>
                    <td>开始日期</td>
                    <td>结果日期</td>
                    <td>手机号码</td>
                    <td>添加日期</td>
                    <td>是否有效</td>
                    
                </tr>
                <{foreach from=$coupon_index_list item=coupon}>
                <tr align='center' bgcolor="#FFFFFF"  onMouseMove="javascript:this.bgColor='#f4fbf4';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
                	<td><input type="checkbox" name="number[]" value="<{$coupon.serial_id}>" /></td>
                    <td><{$coupon.serial_number}></td>
                    <td>
                    	<{foreach from=$coupon_type_list item=type}>
                        <{if $type.type_id == $coupon.type_id}><{$type.type_name}><{/if}>
                        <{/foreach}>
                    </td>
                    <td>
                    	<{foreach from=$coupon_batch_list item=batch}>
                        <{if $batch.batch_id == $coupon.batch_id}><{$batch.batch_name}><{/if}>
                        <{/foreach}>
                    </td>
                    <td><{$coupon.total_value}><{$coupon.unit}></td>
                    <td><{$coupon.remain_value}><{$coupon.unit}></td>
                    <td><{$coupon.print_value}></td>
                    <td><{$coupon.start_date}></td>
                    <td><{$coupon.end_date}></td>
                    <td><{$coupon.mobile}></td>
                    <td><{$coupon.add_date}></td>
                    <td><{if $coupon.is_disabled == 0}><span style="color:#339C33">有效</span><{elseif $coupon.is_disabled == 1}>无效<{elseif $coupon.is_disabled==-1}>未审核<{elseif $coupon.is_disabled==-2}><span style="color:#F00">审核不通过</span><{/if}></td>
                   
                </tr>
                <{/foreach}>
                <tr bgcolor="#FAFAF1">
                	<td height="24" colspan="12">
                    	<input type="hidden" id="number_op" name="op" value="" />
                        <input type='submit' class="coolbg np" value='审核通过' onClick="number_verify()" />&nbsp;&nbsp;
                        <input type='submit' class="coolbg np" value='审核不通过' onClick="number_disverify()" />&nbsp;&nbsp;
                        <{$page_str}>
                    </td>
                </tr>
				</form>
                <!--<tr align="right" bgcolor="#EEF4EA">
                	<td height="20" colspan="9" align="center"></td>
                </tr>-->
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                	<td height="4"></td>
                </tr>
                <tr bgcolor="#FFFFFF">
                	<td height="26"></td>
                </tr>
				<tr>
					<td colspan="2" height="4"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>